
global _main



GLOBAL    powerup, start,_main,_turnon_init
    
    psect    powerup,class=CODE,delta=2
powerup
;	clrwdt
;		set		i2c  	outport
	bcf		3,5
	bsf		3,6
	movlw	0x03
	movwf	0x86
;		set		i2c pic 	low 
	bcf		3,6
	clrw	
	movwf	0x07
;		set 	i2c		inport
	bcf		3,5
	bsf		3,6
	movlw	0x1b
	movwf	0x86
;		clr		reg
	bcf		3,6
	bcf		3,5
	movlw    0
	movwf	0x01;		TMR0
	movwf	0x0b;		INTCON
	movwf	0x0e;		TMR1L
	movwf	0x0f;		TMR1H
	movwf	0x10;		t1con
	movwf	0x15;		ccpr1l
	movwf	0x16;		ccpr1h
	movwf	0x0c;		PIR1
	movwf	0x0d;		PIR2
	movwf	0x0b;		intcon
;	call 	_turnon_init
    movlw    myInit>>8
    movwf    0x0A           ;PCLATH
    movlw    myInit & 0xFF
    movwf    0x02           ;PCL

    psect    MyInit, class=CODE,delta=2
myInit
     ;add you own code here
     
     ;jump to main()
	bsf	3,5
	clrw
	movwf	0x86
	bcf 3,5
	movwf	0x06
	movlw	0x00
	movwf	0x06
	clrwdt
    ljmp      start
end
